Skip to content

Conversation

@seyoon-lim
Copy link


Thank you for contributing to sentry-python! Please add tests to validate your changes, and lint your code using tox -e linters.

Running the test suite on your PR might require maintainer approval. The AWS Lambda tests additionally require a maintainer to add a special label, and they will fail until this label is added.

@seyoon-lim seyoon-lim requested a review from softyoungha August 7, 2024 16:53
@seyoon-lim seyoon-lim force-pushed the feature/support-exists-context branch from 849069e to 4c673d6 Compare August 7, 2024 17:11
@seyoon-lim seyoon-lim force-pushed the feature/support-exists-context branch from c3a5982 to 2f0d7be Compare August 8, 2024 00:21
sl0thentr0py and others added 12 commits August 8, 2024 13:44
This is the code from [sentry-dramatiq](https://github.com/jacobsvante/sentry-dramatiq). 

As described in this GitHub issue (getsentry#3387) @jacobsvante,  the original maintainer of this integration, is not doing any Python anymore and wants to donate his integration to Sentry so we can take care of it. 

This PR adds the current version of the `DramatiqIntegration` to our repo. (The original integrations has been ported to the new SDK 2.x API)

Fixes getsentry#3387
---------

Co-authored-by: Ivana Kellyer <[email protected]>
We removed this line in getsentry#3354 since it is no longer needed, but it was apparently accidentally added back in getsentry#3357.
…y#3428)

Deprecate the Hub-based `is_auto_session_tracking_enabled` and the Scope-based `is_auto_session_tracking_enabled_scope`, and replace them with a new Scope-based private-API equivalent.

Partially implements getsentry#3417
Make several changes to prepare for fully removing Hubs in the next major:
  - Deprecate the Hub-based `auto_session_tracking` function, replacing it with a new Scope-based function called `track_session`
  - Deprecate the scope-based `auto_session_tracking_scope` in favor of the new `track_session` function
  - Change usages of `auto_session_tracking_scope` to `track_sessions`. There are no usages of `auto_session_tracking` outside of tests.
  - Run all tests that were previously run against `auto_session_tracking` also against the new `track_session`. Previously, `auto_session_tracking_scope` was completely untested.

Fixes getsentry#3417
Adds a basic instrumentation for the Ray framework (https://www.ray.io/)

Closes getsentry#2400

----

Co-authored-by: Anton Pirker <[email protected]>
Co-authored-by: Ivana Kellyer <[email protected]>
@seyoon-lim seyoon-lim force-pushed the feature/support-exists-context branch 2 times, most recently from 6323b2a to 541a00f Compare August 13, 2024 13:27
@seyoon-lim seyoon-lim force-pushed the feature/support-exists-context branch from 541a00f to 33e22b5 Compare August 13, 2024 13:28
antonpirker and others added 30 commits December 4, 2024 15:41
* Make ray tests actually test something and show that actors are not supported
…ry#3205)

* fix(grpc): Return propagate proper metadata object instead of list in client interceptor

Fixes getsentry#2509

* fix(grpc): Transform metadata into Metadata object in case it's a tuple

Up until version 1.65.0 of grpcio, the metadata was not guaranteed to
arrive as the type specified in annotations but could be a tuple.
To support versions before that we check and transform it here.

* docs(grpc): Add comment about workaround

---------

Co-authored-by: Anton Pirker <[email protected]>
Co-authored-by: Daniel Szoke <[email protected]>
Add a new `init()` option `add_full_stack` (default `False`), when set to `True` it will add all the missing frames from the beginning of the execution to the stack trace sent to Sentry. 

Also adds another option `max_stack_frames` (default `100`) to limit the number of frames sent. The limitation is only enforced when `add_full_stack=True` to not change behavior for existing users. 

Fixes getsentry#3646
…le (getsentry#3425)

A simple script that parses all libraries we test against from our `tox.ini` and then checks PyPI if this library already supports the newest Python version (currently 3.13)
I was testing Spotlight with Sentry and realized things started to get slow and crashy. It looks like sometimes `args` is just an empty array on cache's `_instruments_call` causing lots of exceptions being thrown. This patch fixes that with explicit length checks and also adds a note for the missing instrumentation for `get_or_set` method. This might be related to getsentry#2122 and getsentry#3300.
Current Spotlight error handling logic gives up sending events to Spotlight after 3 errors. This doesn't make much sense because:

1. Since there is no back off or retry mechanism, even a very brief server hiccup or restart turns off Spotlight reporting
2. Once this shut off kicks in, there is no way to turn it back on except for a server restart

I added a note for future work for retries and some short buffer.
@aliu39 discovered that under certain circumstances a process can get stuck in an infinite loop.  Andrew fixed this by using `deepcopy` which prevents the infinite loop and fixes a bug where the LRU returns incorrect results.  Additionally, I've added a terminating loop in case there are any future bugs we've missed.

Closes: getsentry#3862

Out of precaution, we disabled flagpole evaluation tracking Sentry while we wait for this to be merged.
…entry#3870)

I just got faced with a situation where even trying to do `settings.DEBUG` may trigger a Django exception if the settings are not loaded yet, hence widening the `capture_internal_exceptions()` scope for this.
…g Spotlight (getsentry#3871)

When we inject spotlight, we don't set the correct sidecar URL. This is an issue when a user defines a custom sidecar URL where we are able to load Spotlight UI from the correct URL but don't tell it the correct sidecar URL, making it non-functional.

---------

Co-authored-by: Ivana Kellyer <[email protected]>
---------

Co-authored-by: Ivana Kellyer <[email protected]>
…etsentry#3860)

* Add new integration and unit tests

* Test flag values for LD and OF threaded/asyncio, not just flag names

* update ffIntegration test to be e2e, and fix LRU copy bug

* make a helper fixture and test error processor in original thread

* Move api to top-level, rename to add_flag

* Add docstrs

* Rename to add_feature_flag

* Rm extra import in test_lru_cache

* Revert lru comment

* Type annotate

* Review comments

* Update launchdarkly and openfeature tests to be e2e

* Update docstrs

* Skip threading test for <3.7

* Skip ffs asyncio test if 3.6

* undo 'skip threading test'

* Try commenting out asyncio

* Use importorskip

* Import order

---------

Co-authored-by: Anton Pirker <[email protected]>
…ry#3867)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.0.7 to 5.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v5.0.7...v5.1.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Anton Pirker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.